<%@ page language="java" import="java.util.*" import="java.sql.*"
	import="bean.*" pageEncoding="UTF-8"%>
<%
	request.setCharacterEncoding("UTF-8");
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>


<!DOCTYPE HTML>
<html>
<head>
<base href="<%=basePath%>">

<title>联系人查询系统</title>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="联系人管理系统,">
<meta http-equiv="description" content="联系人管理系统">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">

<link rel="stylesheet"
	href="//cdn.bootcss.com/bootstrap/3.3.5/css/bootstrap.min.css">

<link rel="stylesheet" href="css/theme.css">
</head>

<body>
	<div class="container">
		<div class="mycontainer">
			<h3>欢迎使用联系人查询系统。</h3>
			<%
				if (!"true".equals(request.getAttribute("login"))) {
			%>
			<a class="btn btn-primary" href="login">请您登录!</a>
			<%
				} else {
			%>
			<h3>
				用户<%=request.getAttribute("username")%>你好！ <a href="exit"><input
					type="button" class="btn btn-primary" value="退出" />
			</h3>
			</a>
			<table class="table table-hover table-bordered table-striped">
				<tr>
					<th>联系人</th>
					<th>联系方式</th>
					<th>注释</th>
				</tr>

				<%
					Operation operation = new Operation();
						operation.inquire(String.valueOf(session.getAttribute("id")));
						List<TelInfo> list = (List<TelInfo>) operation.inquire(String.valueOf(session.getAttribute("id")));
						for (TelInfo po : list) {
				%>
				<tr>
					<td><%=po.getName()%></td>
					<td><%=po.getTel()%></td>
					<td><%=po.getRemarks()%></td>
				</tr>

				<%
					}
				%>
			</table>
			<a href="manage"><input type="button"
				class="btn btn-primary btn-lg btn-block" value="管理"></a>
			<%
				}
			%>
		</div>
	</div>
</body>
</html>
